package com.streetsmart;
/**
 * MyEvent is used to store details on user Events. 
 */
import java.util.Date;
/**
 * 
 * @author bhavani sudha
 *
 */
public class MyEvent {
	private String name;
	private String category;
	private MyLocation location;
	private Date startTime;
	private Date endTime;
	private long duration;
	private String state;
	private String type;
	private long id;
	private String imgUrl;
	private String bussName;
	private float rating;
	private long timeToReachThis;
	
	public MyEvent(String name, String category, MyLocation location, Date startTime, Date endTime, String type){
		this.name = name;
		this.category = category;
		this.location = location;
		this.startTime = startTime;
		this.endTime = endTime;
		this.state = "unscheduled";
		this.type = type;
		if(this.type.equals("Good") == true) { long duration = 30 * 60 * 1000; } // approximate unknown events to be of 30 minute duration
		else if(type.equals("Must") == true) { long duration = endTime.getTime() - startTime.getTime(); }
	}
	
	public MyEvent(long id, String name, String category, MyLocation location, Date startTime, Date endTime, String state, String type){
		this.id = id;
		this.name = name;
		this.category = category;
		this.location = location;
		this.startTime = startTime;
		this.endTime = endTime;
		this.state = state;
		this.type = type;
		if(type.equals("Good")) { duration = 30 * 60 * 1000; } // approximate unknown events to be of 30 minute duration
		else if(type.equals("Must")) { duration = endTime.getTime() - startTime.getTime(); }
	}
	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}
	
	/**
	 * @param category the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}
	
	/**
	 * @return the location
	 */
	public MyLocation getLocation() {
		return location;
	}
	
	/**
	 * @param location the location to set
	 */
	public void setLocation(MyLocation location) {
		this.location = location;
	}
	
	/**
	 * @return the startTime
	 */
	public Date getStartTime() {
		return startTime;
	}
	
	/**
	 * @param startTime the startTime to set
	 */
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	/**
	 * @return the endTime
	 */
	public Date getEndTime() {
		return endTime;
	}
	
	/**
	 * @param endTime the endTime to set
	 */
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}
	
	/**
	 * @param state the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}
	
	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}
	
	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}
	
	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}
	
	/**
	 * 
	 * @param id
	 */
	public void setId(int id){
		this.id = id;
	}


	public long getDuration() {
		return duration;
	}


	public void setDuration(long duration) {
		this.duration = duration;
	}

	/**
	 * @return the imgUrl
	 */
	public String getImgUrl() {
		return imgUrl;
	}

	/**
	 * @param imgUrl the imgUrl to set
	 */
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	/**
	 * @return the bussName
	 */
	public String getBussName() {
		return bussName;
	}

	/**
	 * @param bussName the bussName to set
	 */
	public void setBussName(String bussName) {
		this.bussName = bussName;
	}

	/**
	 * @return the rating
	 */
	public float getRating() {
		return rating;
	}

	/**
	 * @param rating the rating to set
	 */
	public void setRating(float rating) {
		this.rating = rating;
	}
	
	/**
	 * @return the timeToReach
	 */
	public long getTimeToReachThis() {
		return timeToReachThis;
	}

	/**
	 * @param timeToReach the timeToReach to set
	 */
	public void setTimeToReachThis(long timeToReach) {
		this.timeToReachThis = timeToReach;
	}
}
